package com.yunkaweilai.android.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;

import com.yunkaweilai.android.R;
import com.yunkaweilai.android.activity.recharge.RenewalRechargeActivity;


/**
 * Created by Administrator on 2016/12/22 0022.
 */

public class GotoRechargeDialog extends Dialog {
    private TextView idTvContent;
    private TextView idTvRight;
    private String msg;
    private String isopen;
    private String storenum;
    private Context context;
    private String url;

    public GotoRechargeDialog(@NonNull Context context, String msg, String isopen, String storenum, String url) {
        super(context, R.style.dialog);
        this.msg = msg;
        this.context = context;
        this.isopen = isopen;
        this.storenum = storenum;
        this.url = url;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_no_time);
        idTvContent = ((TextView) findViewById(R.id.id_tv_content));
        idTvRight = ((TextView) findViewById(R.id.id_tv_right));
        idTvContent.setText(msg);
        if ("1".equals(isopen)) {
            idTvRight.setText("前往自助充值");
        } else {
            idTvRight.setText("确定");
        }
        idTvRight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if ("1".equals(isopen)) {
                    RenewalRechargeActivity.actionStart(getContext(), storenum + "", false);
                } else {

                    dismiss();
                }
            }
        });

    }

}
